#include <atlbase.h>
#include <atlcom.h>
#include <atlstr.h>
#include <atlsafe.h>
#include <comdef.h>

#include<d3d11.h>
#include<d3d11_1.h>
#include<wincodec.h>
#include<dwrite_1.h>
#include<DirectXMath.h>
#include<d2d1helper.h>
#include<d3dcommon.h>
#define LINK_LIBRARY_NAMES (d3d11, d3d11d)
#define LINK_LIBRARY_UNIQUE d3d11

_COM_SMARTPTR_TYPEDEF(ID3D11Device1,               __uuidof(ID3D11Device1));
_COM_SMARTPTR_TYPEDEF(ID3D11DeviceContext1,		   __uuidof(ID3D11DeviceContext1));
_COM_SMARTPTR_TYPEDEF(IWICImagingFactory,		   __uuidof(IWICImagingFactory));
_COM_SMARTPTR_TYPEDEF(IDXGISwapChain1,             __uuidof(IDXGISwapChain1));
_COM_SMARTPTR_TYPEDEF(IDWriteFactory1,             __uuidof(IDWriteFactory1));
_COM_SMARTPTR_TYPEDEF(IDXGIFactory2,               __uuidof(IDXGIFactory2));
_COM_SMARTPTR_TYPEDEF(IDXGIDevice,                 __uuidof(IDXGIDevice));
_COM_SMARTPTR_TYPEDEF(IDXGIDevice1,                __uuidof(IDXGIDevice1));
_COM_SMARTPTR_TYPEDEF(IDXGIAdapter,                __uuidof(IDXGIAdapter));
_COM_SMARTPTR_TYPEDEF(IWICBitmap,                  __uuidof(IWICBitmap));
_COM_SMARTPTR_TYPEDEF(IWICStream,                  __uuidof(IWICStream));
_COM_SMARTPTR_TYPEDEF(IWICBitmapDecoder,           __uuidof(IWICBitmapDecoder));
_COM_SMARTPTR_TYPEDEF(IWICBitmapLock,              __uuidof(IWICBitmapLock));
_COM_SMARTPTR_TYPEDEF(IWICBitmapFrameDecode,       __uuidof(IWICBitmapFrameDecode));
_COM_SMARTPTR_TYPEDEF(IWICFormatConverter,         __uuidof(IWICFormatConverter));

_COM_SMARTPTR_TYPEDEF(ID3D11Device,                __uuidof(ID3D11Device));
_COM_SMARTPTR_TYPEDEF(ID3D11DeviceContext,         __uuidof(ID3D11DeviceContext));
_COM_SMARTPTR_TYPEDEF(ID3D11InputLayout,           __uuidof(ID3D11InputLayout));
_COM_SMARTPTR_TYPEDEF(ID3D11Debug,                 __uuidof(ID3D11Debug));
 

// DXGI
_COM_SMARTPTR_TYPEDEF(IDXGISwapChain,              __uuidof(IDXGISwapChain));
 
 
// States
_COM_SMARTPTR_TYPEDEF(ID3D11BlendState,            __uuidof(ID3D11BlendState));
_COM_SMARTPTR_TYPEDEF(ID3D11DepthStencilState,     __uuidof(ID3D11DepthStencilState));
_COM_SMARTPTR_TYPEDEF(ID3D11RasterizerState,       __uuidof(ID3D11RasterizerState));
_COM_SMARTPTR_TYPEDEF(ID3D11SamplerState,          __uuidof(ID3D11SamplerState));

 
// Resources
_COM_SMARTPTR_TYPEDEF(ID3D11Resource,                                           __uuidof(ID3D11Resource));
_COM_SMARTPTR_TYPEDEF(ID3D11Texture1D,                                          __uuidof(ID3D11Texture1D));
_COM_SMARTPTR_TYPEDEF(ID3D11Texture2D,                                          __uuidof(ID3D11Texture2D));
_COM_SMARTPTR_TYPEDEF(ID3D11Texture3D,                                          __uuidof(ID3D11Texture3D));
_COM_SMARTPTR_TYPEDEF(ID3D11Buffer,                                             __uuidof(ID3D11Buffer));
 
// Views
_COM_SMARTPTR_TYPEDEF(ID3D11View,                                       __uuidof(ID3D11View));
_COM_SMARTPTR_TYPEDEF(ID3D11RenderTargetView,                           __uuidof(ID3D11RenderTargetView));
_COM_SMARTPTR_TYPEDEF(ID3D11ShaderResourceView,                         __uuidof(ID3D11ShaderResourceView));
_COM_SMARTPTR_TYPEDEF(ID3D11DepthStencilView,                           __uuidof(ID3D11DepthStencilView));
_COM_SMARTPTR_TYPEDEF(ID3D11UnorderedAccessView,                        __uuidof(ID3D11UnorderedAccessView));
 
// Shaders
_COM_SMARTPTR_TYPEDEF(ID3D11ComputeShader,                              __uuidof(ID3D11ComputeShader));
_COM_SMARTPTR_TYPEDEF(ID3D11DomainShader,                               __uuidof(ID3D11DomainShader));
_COM_SMARTPTR_TYPEDEF(ID3D11GeometryShader,                             __uuidof(ID3D11GeometryShader));
_COM_SMARTPTR_TYPEDEF(ID3D11HullShader,                                 __uuidof(ID3D11HullShader));
_COM_SMARTPTR_TYPEDEF(ID3D11PixelShader,                                __uuidof(ID3D11PixelShader));
_COM_SMARTPTR_TYPEDEF(ID3D11VertexShader,                               __uuidof(ID3D11VertexShader));
_COM_SMARTPTR_TYPEDEF(ID3D11ClassInstance,                              __uuidof(ID3D11ClassInstance));
 
_COM_SMARTPTR_TYPEDEF(ID3D11ClassLinkage,                               __uuidof(ID3D11ClassLinkage));